
#ifndef TRIGGER_AUDIO_SYSTEM_H
#define TRIGGER_AUDIO_SYSTEM_H

#include <boost/shared_ptr.hpp>
#include "config.h"

class Track;

namespace FMOD {
    class System;
    class Sound;
    class Channel;
}

class AudioSystem
{
public:
    class AudioSystemKey {
        AudioSystemKey() {}
        AudioSystemKey(const AudioSystemKey&) {}
        friend class Track;
    };
    
    typedef boost::shared_ptr<FMOD::Sound  > SoundPtr;
    typedef boost::shared_ptr<FMOD::Channel> ChannelPtr;
    typedef boost::shared_ptr<FMOD::System > SystemPtr;
    
public:
    AudioSystem();
    AudioSystem(const Config& config);
    
    void listDevices();
    
    SoundPtr createSound(const std::string& path, bool stream, AudioSystemKey);
    ChannelPtr playSound(const SoundPtr& sound, AudioSystemKey);
    
private:
    SystemPtr m_system;
};

#endif
